from django.db import models


class Person(models.Model):
    """ 
    The base model to define a person.
    """

    first_name = models.CharField(max_length=50)
    middle_name = models.CharField(max_length=50, blank=True)
    last_name = models.CharField(max_length=100, blank=True)
    mug_shot = models.ImageField(
                upload_to='upload/people/person/', 
                blank=True, null=True,
                help_text="Optional, but should be 200px wide.  Typically a picture of your shoulders, neck and face.")

    def __unicode__(self):
        return self.get_display_name()

    # not used right now since we are not supporting profile pages. leaving
    # here nonetheless.
    #def get_absolute_url(self):
    #    return reverse("people_profile_detail", self.user.username)
    #get_absolute_url = models.permalink(get_absolute_url)
        
    def get_display_name(self):
            return "%s %s %s" % ( 
                                self.first_name,
                                self.middle_name,
                                self.last_name,)
